<html>
	<head>
		<meta charset="utf-8" />
		<title>登录</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link rel="shortcut icon" href="img/icofont.png" />
		<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="css/main.css"/>
		<script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<section class="header">
			<div class="head">
				<nav class="navbar  wow fadeInDown" id="header-nav">
				  <div class="">
				    <!-- Brand and toggle get grouped for better mobile display -->
				    <div class="navbar-header">
				      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
				        <span class="sr-only">Toggle navigation</span>
				        <span class="icon-bar"></span>
				        <span class="icon-bar"></span>
				        <span class="icon-bar"></span>
				      </button>
				      <a class="navbar-brand" href="index.html">See Dream</a>
				    </div>
				
				    <!-- Collect the nav links, forms, and other content for toggling -->
				    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
				      <ul class="nav navbar-nav">
				        <li><a href="#">美食资讯</a></li>
				        <li><a href="#">在线订购</a></li>
				        <li><a href="#">收信箱</a></li>
				      </ul>
				      <ul class="nav navbar-nav navbar-right">
				        <li><a href="login.html">登录</a></li>
				        <li><a href="register.html">注册</a></li>
				      </ul>
				    </div><!-- /.navbar-collapse -->
				  </div><!-- /.container-fluid -->
				</nav>
			</div>
		</section>
		
		<section class="login-container">
			<div class="container">
				<div class="row">
					<div class="col-md-6 col-sm-6 hidden-12">
						<div class="img-login">
							<div class="row">
								<a href="#" class="col-md-4 col-sm-4 col-xs-4">
									<span class="icon"></span>
								</a>
								<a href="#" class="col-md-4 col-sm-4 col-xs-4">
									<span class="icon"></span>
								</a>
								<a href="#" class="col-md-4 col-sm-4 col-xs-4">
									<span class="icon"></span>
								</a>
							</div>
						</div>
					</div>
					<div class="col-md-6 col-sm-6 col-xs-12">
						<h2>See Dream 登录</h2>
						<form action="#" method="post">
						    <input type="text" name="account" id="account" class="account" placeholder="用户名">
						   	<input type="password" name="password" id="password" class="password" placeholder="密码">
						   	<div class="alert alert-danger alert-dismissible" role="alert" style="display: none;">
							 
							</div>
						    <button class="submit" id="btn" type="submit">提交</button>
						</form>
					</div>
				</div>
			</div>
			
		</section>
		
		<footer>
	    	<div class="container">
	    		<nav>
					<ul>
						<li><a href="index.html#myCarousel">主页</a></li>
						<li><a href="main.html">美食资讯</a></li>
						<li><a href="#">在线订购</a></li>
						<li><a href="#">收信箱</a></li>
						<li><a href="login.html">登录</a></li>
						<li><a href="register.html">注册</a></li>
					</ul>
				</nav>
				<h2>See Dream</h2>
				<p>电话:1234-1234567&nbsp; &nbsp; 邮箱:royal_zhaoshai@163.com &nbsp; &nbsp; 地址:中国北京 </p>
				<p>(c) Copyright 2017 赵帅-zs. All Rights Reserved. </p>
	    	</div>
	    </footer>
		
		<script src="js/date/user.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
	  	window.onload = function(){
			var account = document.getElementById("account");
			var pass = document.getElementById("password");
			var btn = document.getElementById("btn");
			var alert = document.getElementsByClassName("alert");
			btn.onclick = function(){
				var t;
				if(account.value.length == 0 || pass.value.length == 0){
					alert[0].innerHTML="用户名或密码不得为空！";
					alert[0].style.display = "block";
					t=false;
				}else{
					alert[0].innerHTML="";
					alert[0].style.display = "none";
					t=true;
				}
				
				
				if(t){
					var t;
					for(var i = 0;i<user.length;i++){
						if(account.value==user[i].account && pass.value==user[i].password){
							t=true;
							break
						}else{
							t=false;
						}
						console.log(t);
					}
					if(t){
						window.location.href="main.html";
					}else{
						alert[0].innerHTML="用户名或密码不正确！";
						alert[0].style.display = "block";
					}
				}
				
			return false;
			}
			
	  		
	  	}
	  </script>
	</body>
</html>